package factoryModel.abstractFactoryModel.pizza;

import factoryModel.abstractFactoryModel.factory.PizzaIngredientFactory;

/**
 * @author 帅小伙
 * @date 2021/12/29
 * @description
 */
public class AhPizza extends Pizza{
    PizzaIngredientFactory ingredientFactory;

    public AhPizza(PizzaIngredientFactory ingredientFactory) {
        this.ingredientFactory = ingredientFactory;
        prepare();
    }

    @Override
    void prepare() {
        System.out.println("开始准备:原材料");
        dough = ingredientFactory.createDough();
        cheese = ingredientFactory.createCheese();
        make();
    }
}
